package com.ego.common.constant;


/**
 * @program: ego
 * @description: 促销活动相关常量及枚举
 * @author: KamTang
 * @create: 2022-12-31 09:01
 **/
public class CouponConstant {

    /**
     * 促销活动在缓存中的存储前缀
     */
    public static final String SESSION_CACHE_PREFIX = "seckill:session:";

    /**
     * 秒杀商品在缓存中的存储前缀
     */
    public static final String SKU_SECKILL_CACHE_PREFIX = "seckill:sku:";

    /**
     * 秒杀商品库存信号量
     */
    public static final String SKU_STOCK_SEMAPHORE = "seckill:stock:";

    /**
     * 秒杀商品购物车
     */
    public static final String CART_SECKILL_CACHE_PREFIX = "seckill:cart:";

    /**
     * 秒杀商品上架的分布式锁CART_PREFIX
     */
    public static final String SECKILL_SKU_UPLOAD_LOCK = "seckill:upload:lock";

    /**
     * 活动状态枚举
     */
    public enum SessionStatusEnum {
        /**
         * 活动开启、未开启
         */
        ENABLE(1),
        DISABLE(0);

        private final int code;

        SessionStatusEnum(int code) {
            this.code = code;
        }


        public int getCode() {
            return code;
        }
    }
}
